import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // //默认路由
    {path: '/',
    name: '',
    component: () => import('@/views/Login.vue'),
    },
    //登录路由
    {path: '/login',name: 'Login',component: () => import('@/views/Login.vue'),},
    
    //主管路由
    {
      path: '/manager',
      name: 'Manager',
      component: () => import('@/views/manager/Manager.vue'),
      redirect: '/home',
      children: [
        { path: '/home', name: 'Home', component: () => import('@/views/manager/Home.vue')},
        { path: '/managerInfo', name: 'ManagerInfo', component: () => import('@/views/manager/ManagerInfo.vue')},
        { path: '/manager_project', name: 'Manager_Project', component: () => import('@/views/manager/Manager_Project.vue')},
        { path: '/myfile', name: 'Myfile', component: () => import('@/views/manager/Myfile.vue')},
      ]
    },

    //员工路由
    {path: '/staff',
     name: 'Staff',
     component: () => import('@/views/staff/Staff.vue'),
     redirect:'/home_staff',
     children:[
      {path:'/home_staff',name:'Home_staff',component:()=>import('@/views/staff/Home_staff.vue')},
      {path:'/project_staff',name:'Project_staff',component:()=>import('@/views/staff/Project_staff.vue')},
      {path:'/myfile_staff',name:'Myfile_staff',component:()=>import('@/views/staff/Myfile_staff.vue')},
      {path:'/info_staff',name:'Info_staff',component:()=>import('@/views/staff/Info_staff.vue')},
     ]
    },

    //老板路由
    {path: '/boss',
     name: 'Boss',
     component: () => import('@/views/boss/Boss.vue'),
     redirect:'home_boss',
     children:[
      {path:'/home_boss',name:'Home_boss',component:()=>import('@/views/boss/Home_boss.vue')},
      {path:'/project_boss',name:'Project_boss',component:()=>import('@/views/boss/Project_boss.vue')},
      {path:'/myfile_boss',name:'Myfile_boss',component:()=>import('@/views/boss/Myfile_boss.vue')},
      {path:'/customer_boss',name:'Customer_boss',component:()=>import('@/views/boss/Customer_boss.vue')},
      {path:'/employee_boss',name:'Employee_boss',component:()=>import('@/views/boss/Employee_boss.vue')},
      {path:'/bossInfo',name:'BossInfo',component:()=>import('@/views/boss/BossInfo.vue')},
      {path:'/jixiao_boss',name:'Jixiao_boss',component:()=>import('@/views/boss/Jixiao_boss.vue')},
      {path:'/position',name:'Position',component:()=>import('@/views/boss/Position.vue')},
      {path:'/monitor',name:'Monitor',component:()=>import('@/views/boss/Monitor.vue')},
     ]
    },

    //前台路由
    {
      path: '/apprentice',
      name: 'Apprentice',
      component: () => import('@/views/apprentice/Apprentice.vue'),
      redirect:'/home_apprentice',
      children: [
        { path: '/home_apprentice', name: 'Home_apprentice', component: () => import('@/views/apprentice/Home_apprentice.vue')},
        { path: '/apprenticeInfo', name: 'ApprenticeInfo', component: () => import('@/views/apprentice/ApprenticeInfo.vue')},
        { path: '/customer', name: 'Customer', component: () => import('@/views/apprentice/Customer.vue')},
        { path: '/employee', name: 'Employee', component: () => import('@/views/apprentice/Employee.vue')},
      ]
    },

  ]
})

export default router
